<?php // no direct access
defined('_JEXEC') or die('Restricted access');
$link = JRoute::_('index.php?option=com_sim' );
?>
<form action="<?php echo $link?>" method="get">
    <div class="search">
        <?php
        $searchword = JRequest::getVar("searchword");
        $text = 'Nhập số sim cần tìm';
        if ($searchword == "") {
            $output = '<input name="searchword" id="mod_search_searchword" maxlength="20" alt="Nhập số sim" class="inputbox" type="text" style="width:80%;margin-left:10px;" value="' . $text . '"  onblur="if(this.value==\'\') this.value=\'' . $text . '\';" onfocus="if(this.value==\'' . $text . '\') this.value=\'\';" />';
        } else {
            $output = '<input name="searchword" id="mod_search_searchword" maxlength="20" alt="Nhập số sim" value="' . $searchword . '" class="inputbox" type="text" style="width:80%;margin-left:10px;" value="' . $text . '"  onblur="if(this.value==\'\') this.value=\'' . $text . '\';" onfocus="if(this.value==\'' . $text . '\') this.value=\'\';" />';
        }

        $minprice = JRequest::getVar("minprice");
        $minpricearray = array(
            '' => 'Giá thấp nhất',
            '100' => '100 K',
            '200' => '200 K',
            '400' => '400 K',
            '800' => '800 K',
            '1000' => '1 triệu',
            '1500' => '1,5 triệu',
            '2000' => '2 triệu',
            '5000' => '5 triệu',
            '10000' => '10 triệu'
        );
        $minmoney = '<select name = "minprice" class="inputbox" style="width: 85%; margin-left: 10px;">';
        foreach ($minpricearray as $value => $valuetext) {
            if ($minprice == $value) {
                $minmoney .= '<option value="' . $value . '" selected="selected">' . $valuetext . '</option>';
            } else {
                $minmoney .= '<option value="' . $value . '">' . $valuetext . '</option>';
            }
        }
        $minmoney .= '</select>';
        //$minmoney = '<input name="minprice" alt="'.$minprice.'" class="inputbox'.$moduleclass_sfx.'" type="text" style="width:80%;margin-left:10px;" value="'.$minprice.'"  onblur="if(this.value==\'\') this.value=\''.$minprice.'\';" onfocus="if(this.value==\''.$minprice.'\') this.value=\'\';" />';
        $maxprice = JRequest::getVar("maxprice");
        $maxpricearray = array(
            '' => 'Giá cao nhất',
            '100' => '100 K',
            '200' => '200 K',
            '400' => '400 K',
            '800' => '800 K',
            '1000' => '1 triệu',
            '1500' => '1,5 triệu',
            '2000' => '2 triệu',
            '5000' => '5 triệu',
            '10000' => '10 triệu'
        );
        $maxmoney = '<select name = "maxprice" class="inputbox" style="width: 85%; margin-left: 10px;">';
        foreach ($maxpricearray as $value => $valuetext) {
            if ($maxprice == $value) {
                $maxmoney .= '<option value="' . $value . '" selected="selected">' . $valuetext . '</option>';
            } else {
                $maxmoney .= '<option value="' . $value . '">' . $valuetext . '</option>';
            }
        }
        $maxmoney .= '</select>';
        ////'<input name="maxprice" maxlength="'.$maxlength.'" alt="'.$maxprice.'" class="inputbox'.$moduleclass_sfx.'" type="text" style="width:80%;margin-left:10px;" value="'.$maxprice.'"  onblur="if(this.value==\'\') this.value=\''.$maxprice.'\';" onfocus="if(this.value==\''.$maxprice.'\') this.value=\'\';" />';
        $button = '<div align="center"><input type="submit" value="Tìm kiếm" class="button" onclick="this.form.searchword.focus();"/></div>';

        $button = '<br />' . $button;
        $provider = '<br />' . $provider;
        $category = '<br />' . $category;
        $minmoney = '<br />' . $minmoney;
        $maxmoney = '<br />' . $maxmoney;
        $output = $output . $provider . $minmoney . $maxmoney . $category . $button;
        echo $output;
        ?>
    </div>
    <input type="hidden" name="task" value="" />
</form>